package com.only4play.pcc.rest;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.Instant;

/**
 * @author liyuncong
 * @version 1.0
 * @file AbstractResponse
 * @brief AbstractResponse
 * @details AbstractResponse
 * @date 2024-06-24
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2024-06-24               liyuncong          Created
 */

@Getter
@Setter
@NoArgsConstructor
public abstract class AbstractResponse {

    protected Integer error_code;
    protected String error_message;
    protected Long timestamp;

    public AbstractResponse(Integer errorCode, String errorMsg) {
        this.error_code = errorCode;
        this.error_message = errorMsg;
        this.timestamp = Instant.now().toEpochMilli();
    }
}
